import ClientData from "./ClientData";
import SystemConfig from "./SystemConfig";
import BasePageCtrl, { AnimType } from "./BasePageCtrl";
import UiManage from "./UiManage";
import AboutPage from "./AboutPage";
import UiManager from "./UiManage";

const { ccclass, property } = cc._decorator;

@ccclass
export default class AboutPageCtrl extends BasePageCtrl {
    ui: AboutPage = null;

    constructor() {
        super();
        this.ui = null;
    }

    onLoad() {
        this.onUILoad();
        this._animType = AnimType.NONE;
        this._touchControl = false;
        this._hasPeneLock = true;
        this._hasBlack = true;
        this._hasTouchLock = false;
        super.onLoad();
        this.addButtonListen();
    }

    start() {}

    onUILoad() {
        this.ui = this.node.addComponent(AboutPage);
    }

    addButtonListen() {
        UiManager.addButtonListen(this.ui.btn_close, this.clickClose, this);
    }

    _init() {
        this.ui.label_game_name.getComponent(cc.Label).string = SystemConfig.GAME_NAME;
        // this.ui.label_version.getComponent(cc.Label).string = "V" + HotUpdate.getInstance().getVersion();
        // this.ui.label_app_version.getComponent(cc.Label).string = ClientData.version_name || "";
        // this.ui.label_channel.getComponent(cc.Label).string = ClientData.channel_name || "";
    }

    clickClose() {
        this.hide();
    }

    static prefabUrl = "AboutPage";
    static className = "AboutPageCtrl";
}
